Computer networks are becoming pervasive because people wish to send, receive, and share information. At a simple level, a network can be thought of as end-points, which might be computers or other electronic devices, connected via infrastructure (e.g., transmission links and switches). The end-points, transmission links, and switches may have different capabilities. For example, one end-point might be a mainframe computer while another end-point might be a pocket computer, and one link might be a telephone line while another link might be a dedicated high-speed cable. Because networks can have such disparate end-points and links, networks typically use a technique called “flow control” to control the flow of data in an attempt to increase performance. Three types of flow control are discussed below.
Ethernet Flow Control
Ethernet offers a method of flow control based on a receive-buffer fullness threshold. This Ethernet flow-control standard is covered in the IEEE 802.3x specification. It is intended to reduce buffer overruns, which result in frame loss. Frame loss reduces network reliability and available bandwidth and hurts performance.
In Ethernet flow control, as a receiving end-point receives frames, they are placed into a buffer. The frames are processed, and the buffer space they used is then available for subsequent frames. If the rate of incoming frames exceeds the rate at which the receiver can process them, the buffer begins to fill up. When a fullness threshold is exceeded, the receiver sends a pause frame to its link-partner, e.g. a switch. A pause frame causes the switch to stop sending frames. This allows the receiver time to process the already-received frames and prevents the receiver's buffer from overflowing with subsequent frames.
Ethernet flow control works well from the perspective of the receiver. But, this only moves the problem from the receiver to the switch. Pause frames are not sent to the source of the frames (the sender); they are only sent from link-partner to link-partner (e.g. the receiving end-point to the switch). If the switch were to propagate the pause frame, then this could unnecessarily slow communications across the network. So, pause frames are not propagated, and the sender that is causing congestion is not informed that the receiver is nearly full. This means that the switch is receiving frames, but it is not allowed to forward them. This results in the switch dropping frames when its buffer size is exceeded. Thus, the primary drawback to Ethernet flow control is that it is not connection oriented. Instead it is a point-to-point (link-partner to link-partner) protocol that has no concept of an end-to-end (sender-to-receiver) connection.
TCP Flow Control
TCP (Transmission Control Protocol) has a different flow-control mechanism from the Ethernet. When a connection is initially established, TCP sends at a slow data rate to assess the bandwidth of the connection and to avoid overflowing the receiver or any other infrastructure in the network path, such as routers or switches that the frames must traverse to get from the sender to the receiver. The send window starts at a small size. As TCP/IP segments are acknowledged, the send window is increased until the amount of data being sent per burst reaches the size of the receiver's window. At that point, the slow-start algorithm is no longer used and the receiver's window governs TCP flow control. But, at any time during transmission, congestion can still occur on a connection. If this happens (evidenced by missing acknowledgments and the need to retransmit), a congestion-avoidance algorithm is used to reduce the send-window size temporarily, and then to slowly increment the send window back towards the receiver's window size.
The primary disadvantage to the TCP flow-control algorithm is that it is reactive instead of proactive. That is, frames must be dropped before TCP at the sender realizes that there is a congestion issue. Because TCP detects dropped frames by waiting for acknowledgments to time out, multiple round-trip time delays may occur before TCP realizes that a frame has been dropped. Also, TCP's congestion control has no visibility to the buffer-fullness state, which is a primary reason for frame loss.
Combining Ethernet Flow Control with TCP Flow Control
TCP flow control is connection oriented and reactive while Ethernet is point-to-point oriented and proactive. Based on these factors alone, it might seem that a network running TCP with Ethernet flow control would reap the benefits of both. Unfortunately, the opposite is true.
Using a combined Ethernet/TCP flow-control technique, as a buffer in a receiver approaches fullness, the receiver sends a pause frame to the switch. The switch then begins to buffer frames destined for the receiver, so congestion has occurred, but no frames have yet been dropped. The switch will send the buffered frames to the receiver as soon as a pause timer, started by the pause frame, expires. The delay in forwarding due to pause frames is significantly smaller than the acknowledgment time-out of TCP. Because TCP at the sender depends on dropped frames to detect congestion, and these buffered frames were not dropped, TCP cannot detect that congestion has occurred. Thus, Ethernet flow control delays frame droppage, which allows TCP flow control to continue to receive acknowledgments, even for frames that were involved in congestion. Based on these acknowledgments, TCP flow control may even increase the data rate on the connection. This only exacerbates the congestion problem, resulting in a greater number of frames that are dropped at the switch and therefore a greater number of frames that will need to be retransmitted.
Conclusion
Both Ethernet and TCP flow control have significant limitations. Ethernet flow control is not connection oriented and only moves the problem from the receiver to the infrastructure (e.g. the switch). TCP flow control is slow to react and requires frames to be dropped before congestion is detected. Finally, when the two flow-control mechanisms are used together, the combination makes their separate limitations worse.